﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StoreToSell.aspx.cs" Inherits="Web.User.Exchange.StoreToSell" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="../../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Scripts/WebInner.js" type="text/javascript"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
    <link href="../../Styles/Common.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/Zebra/zebra_dialog.js" type="text/javascript"></script>
    <link href="../../Scripts/Zebra/zebra_dialog.css" rel="stylesheet" type="text/css" />
    <script src="../../Lodop6.198/LodopFuncs.js" type="text/javascript"></script>

      <script type="text/javascript">
          /*--------窗体启动设置和基本设置--------*/
          /*--loadFuntion--*/
          $(function () {

              var Dep_SID = getQueryString("Dep_SID");
              var ApplyID = getQueryString("ApplyID"); //存转销申请编号
              if (ApplyID != '') {
                  $('input[name=VarietyCount]').attr('readonly', 'readonly');
                  $('input[name=VarietyCount]').css('background', '#ccc');
                  $('input[name=ApplyID]').val(ApplyID);
                  //加载申请存转销的数量
                  $.ajax({
                      url: '/Ashx/exchangeprop.ashx?type=GetApplyCount&ApplyID=' + ApplyID,
                      type: 'post',
                      data: '',
                      dataType: 'text',
                      success: function (r) {
                          $('input[name=VarietyCount]').val(r);

                      }, error: function (r) {
                          $.Zebra_Dialog('<strong>加载审批的存转销产品数量时发生错误 ！</strong>');
                      }
                  });

              }
              if (Dep_SID != "") {
                  $('#divSell').fadeIn("normal");
                  $('input[name=txtDep_SID]').val(Dep_SID);

                  //查找当前选择的存储信息
                  InitStorageInfo(Dep_SID);
                  //加载当前的储户信息
                  InitDepositor(Dep_SID);
              }

             

              //显示日期
              var now = new Date(); //获取系统日期，即Sat Jul 29 08:24:48 UTC+0800 2006 
              var yy = now.getFullYear(); //截取年，即2006 
              var mo = now.getMonth() + 1; //截取月，即07 
              var dd = now.getDate(); //截取日，即29 
              //取时间 
              var hh = now.getHours(); //截取小时，即8 
              var mm = now.getMinutes(); //截取分钟，即34 
              var ss = now.getSeconds(); //获取秒 
              $('#dt_Sell').val(yy + '-' + mo + '-' + dd + ' ' + hh + ':' + mm + ':' + ss);
              $('#P_RiQi').html(yy + '-' + mo + '-' + dd); //显示打印日期

          });




          //申请存转销
          function FunApply() {
              var Dep_SID = $('input[name=txtDep_SID]').val();
              window.location.href = "/User/Exchange/Apply/ApplyToSell.aspx?Dep_SID=" + Dep_SID;
          }

          function FunJiSuan() {
              var VarietyCount = $.trim($('input[name=VarietyCount]').val());
              if (VarietyCount == '' || VarietyCount == '0') {
                  $.Zebra_Dialog('<strong>请输入存转销数量 ！</strong>');
                  return false;
              }
              $.ajax({
                  url: '/Ashx/exchangeprop.ashx?type=SellJiSuan&txtDep_SID=' + $('input[name=txtDep_SID]').val() + '&VarietyCount=' + VarietyCount,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {
                      $('input[name=txtLiXi]').val(r.LiXi);
                      $('input[name=txtBGF]').val(r.BGF);
                      $('input[name=VarietyCount]').val(r.Count);
                      $('input[name=VarietyMoney]').val(r.Money);
                      $('#divMsg').html('');
                      $('#divMsg').append(r.Msg);
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>计算操作失败 ！</strong>');
                  }
              });
          }

          function FunFanSuan() {
              var VarietyMoney = $.trim($('input[name=VarietyMoney]').val());
              if (VarietyMoney == '' || VarietyMoney == '0') {
                  $.Zebra_Dialog('<strong>请输入存转销金额 ！</strong>');
                  return false;
              }
              $.ajax({
                  url: '/Ashx/exchangeprop.ashx?type=SellFanSuan&txtDep_SID=' + $('input[name=txtDep_SID]').val() + '&VarietyMoney=' + VarietyMoney,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {
                      $('input[name=txtLiXi]').val(r.LiXi);
                      $('input[name=txtBGF]').val(r.BGF);
                      $('input[name=VarietyCount]').val(r.Count);
                      $('input[name=VarietyMoney]').val(r.Money);
                      $('#divMsg').html('');
                      $('#divMsg').append(r.Msg);
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>反算操作失败 ！</strong>');
                  }
              });
          }

          function frmSubmit() {
              var StorageNum = $("input[name=VarietyCount]").val();


              if (!CheckNumDecimal($("input[name=VarietyCount]").val(), '存转销数量', 2)) {
                  return false;
              }
              if ($("input[name=VarietyCount]").val() == '' || $("input[name=VarietyCount]").val() == '0') {
                  $.Zebra_Dialog('<strong>请输入存转销数量 ！</strong>');
                  return false;
              }
              if (parseFloat($("input[name=VarietyCount]").val()) > parseFloat($('input[name=txtJieCun]').val())) {
                  $.Zebra_Dialog('<strong>储户的产品结存数量不足，请重新指定存转销数量 ！</strong>');
                  return false;
              }
             
              var strUrl = '/Ashx/exchangeprop.ashx?type=StoreToSell';
              if ($('input[name=ApplyID]').val() != '') {
                   strUrl = '/Ashx/exchangeprop.ashx?type=StoreToSell&ApplyID=' + $('input[name=ApplyID]').val();
              }
              if (confirm('您确认已经认真检查输入信息，并继续操作吗？')) {
                  $.ajax({
                      url: strUrl,
                      type: 'post',
                      data: $('#form1').serialize(),
                      dataType: 'text',
                      success: function (r) {
                          $.Zebra_Dialog('<strong>存转销操作成功 ！</strong>');
                          $('#btnAdd').attr('disabled', 'disabled');
                          $('#btnAdd').css('background', '#aaa');
                          $('#btnPrint').removeAttr('disabled');
                          $('#btnPage').removeAttr('disabled');

                          $('#Query').fadeOut(); //隐藏查询按钮
                         
                      }, error: function (r) {
                          $.Zebra_Dialog('<strong>存转销操作失败 ！</strong>');
                      }
                  });
              }
          }

          function InitStorageInfo(Dep_SID) {
              $.ajax({
                  url: '/User/Exchange/exchange.ashx?type=GetStorageInfoByID&ID=' + Dep_SID,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {

                      $('#StorageList').hide();
                      $('#Storage').show();
                      $('#depositorInfo').show();
                      $('#VarietyID').html(r[0].VarietyID);
                      $('#StorageNumber').html(r[0].StorageNumber);
                      $('input[name=txtJieCun]').val(r[0].StorageNumber); //记录结存数量
                      $('#StorageDate').html(r[0].StorageDate);
                      $('input[name=txtVarietyPrice]').val(r[0].Price_ShiChang);
                      $('#Price_ShiChang').html(r[0].Price_ShiChang);
                      $('input[name=txtPrice_ShiChang]').val(r[0].Price_ShiChang);
                      $('#TimeID').html(r[0].TimeID);
                      $('#numDate').html(r[0].numDate);

                      $('input[name=txtVarietyID]').val(r[0].txtVarietyID);
                      $('input[name=txtTimeID]').val(r[0].txtTimeID);


                      $('#spanUnit').html(r[0].UnitID);
                      $('#spanUnit2').html(r[0].UnitID);
                      $('#spanUnit3').html(r[0].UnitID);

                      InitStorageRate(r[0].txtVarietyID, r[0].txtTimeID);
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载储户存储信息失败 ！</strong>');
                  }
              });
          }

          function InitStorageRate(VarietyID,TimeID) {
              $.ajax({
                  url: '/User/Exchange/exchange.ashx?type=GetStorageRateByID&TimeID=' + TimeID + '&VarietyID=' + VarietyID,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {

                      $('input[name=StorageFee]').val(r[0].StorageFee);
                      $('input[name=CurrentRate]').val(r[0].CurrentRate);
                      $('input[name=ISRegular]').val(r[0].ISRegular);
                      $('input[name=InterestType]').val(r[0].InterestType);
                      $('input[name=numStorageDate]').val(r[0].numStorageDate);
                      $('input[name=PricePolicy]').val(r[0].PricePolicy);
                      var strStorageDate = $('#StorageDate').html();
                      strStorageDate = strStorageDate.replace(/-/g, "/");
                      var StorageDate = new Date(strStorageDate);
                      var DateNow = new Date();

                      var diffday = DateNow - StorageDate;
                      diffday = diffday.toFixed(2) / 86400000;
                      diffday = diffday.toString().substring(0, diffday.toString().indexOf('.'));

                      $('input[name=DepStorageDate]').val(diffday);
                      if (r[0].ISRegular) {//当前是定期储户
                          if (Date.parse(StorageDate) < Date.parse(DateNow)) { //当前产品未到约定存期
                              if ($('input[name=ApplyID]').val() == '') {//档次不是审批结果跳转的界面
                                  $('#trApply').show();
                                  $('#trSell').hide();
                                  $('#divMsg').html('');
                                  $('#divMsg').append("储户类型：<span style='color:Blue'>定期,</span>");
                                  $('#divMsg').append("存期：<span style='color:Blue'>" + $('#TimeID').html() + ",</span>");
                                  $('#divMsg').append("约定存期：<span style='color:Blue'>" + $('input[name=numStorageDate]').val() + "天,</span>");
                                  $('#divMsg').append("实际存期：<span style='color:Blue'>" + $('input[name=DepStorageDate]').val() + "天,</span>");
                                  $('#divMsg').append("未授权，不能存转销，您可以向管理员申请存转销.");
                              } else {
                                  $('#trApply').hide();
                                  $('#trSell').show();
                              }
                          } else {//当前产品超过规定存期 
                              $('#trApply').hide();
                              $('#trSell').show();
                          }
                      } else {//当前是非定期储户
                          $('#trApply').hide();
                          $('#trSell').show();
                      }

                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载储户存储信息失败 ！</strong>');
                  }
              });
          } 

          function InitDepositor(Dep_SID) {
              $.ajax({
                  url: '/User/Exchange/exchange.ashx?type=GetDepInfoByStorageID&ID=' + Dep_SID,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {
                      $('#StorageList').hide();
                      $('#Storage').show();
                      $('#depositorInfo').show();
                      $('#QAccountNumber').val(r[0].AccountNumber);

                      $('#D_AccountNumber').html(r[0].AccountNumber);
                      $('#D_strName').html(r[0].strName);
                      $('#D_PhoneNo').html(r[0].PhoneNO);
                      $('#D_strAddress').html(r[0].strAddress);
                      $('#D_numState').html(r[0].numState);
                      $('#D_IDCard').html(r[0].IDCard);

                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载储户存储信息失败 ！</strong>');
                  }
              });
          }


          /*--ENd loadFuntion--*/



          /*--------End 数据增删改操作--------*/

          var p_left = 0; var p_ltop = 0; var p_lwidth = 0; var p_lheight = 0;
          $(function () {
              $.ajax({
                  url: '/Ashx/wbinfo.ashx?type=GetPrintSetting_Dep',
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {
                      p_lwidth = r[0].Width;
                      p_lheight = r[0].Height;
                      p_lleft = r[0].DriftRateX;
                      p_ltop = r[0].DriftRateY;
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载打印坐标时出现错误 ！</strong>');
                  }
              });
          });
          //存折打印
          function CreateOneFormPage() {
              LODOP = getLodop();
              LODOP.PRINT_INIT("存折打印");
              LODOP.SET_PRINT_STYLE("FontSize", 18);
              LODOP.SET_PRINT_STYLE("Bold", 1);
              LODOP.ADD_PRINT_TEXT(0, 0, 0, 0, "打印页面部分内容");
          
              LODOP.ADD_PRINT_HTM(p_ltop, p_lleft, p_lwidth, p_lheight, document.getElementById("divPrint").innerHTML);

          };



          //加载新的业务编号
          function InitBusinessNO() {
              $.ajax({
                  url: "/User/Storage/storage.ashx?type=GetNewBusinessNO&AccountNumber=" + $('#D_AccountNumber').html(),
                  type: 'post',
                  data: '',
                  dataType: 'text',
                  success: function (r) {
                      $('input[name=BusinessNO]').val(r);
                     
                      frmSubmit(); //提交表单
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载信息失败 ！</strong>');
                  }
              });
          }


          function PrintCunZhe() {

              $.ajax({
                  url: '/Ashx/storage.ashx?type=PrintDep_OperateLog&BusinessNO=' + $('input[name=BusinessNO]').val() + '&AccountNumber=' + $('#D_AccountNumber').html(),
                  type: 'post',
                  data: '',
                  dataType: 'text',
                  success: function (r) {
                      $('#divPrint').html('');
                      $('#divPrint').append(r);
                      CreateOneFormPage();
                      LODOP.PREVIEW(); //打印存折
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载打印坐标时出现错误 ！</strong>');
                  }
              });
          }
          


          function PrintPage() {
              $.ajax({
                  url: '/Ashx/storage.ashx?type=PrintStorageSell&BusinessNO=' + $('input[name=BusinessNO]').val() + '&AccountNumber=' + $('#D_AccountNumber').html(),
                  type: 'post',
                  data: '',
                  dataType: 'text',
                  success: function (r) {
                      $('#divPrintPaper').html('');
                      $('#divPrintPaper').append(r);
                      CreatePage();
                      LODOP.PREVIEW(); //打印存折
                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>加载打印坐标时出现错误 ！</strong>');
                  }
              });
             
          }

          //小票打印
          function CreatePage() {
              LODOP = getLodop();
              LODOP.PRINT_INIT("小票打印");
              LODOP.SET_PRINT_STYLE("FontSize", 12);
              LODOP.SET_PRINT_STYLE("Bold", 1);
              LODOP.ADD_PRINT_TEXT(0, 0, 0, 0, "打印页面部分内容");

              LODOP.ADD_PRINT_HTM(20, 60, 800, 400, document.getElementById("divPrintPaper").innerHTML);

          };


      </script>
</head>
<body>
    <div id="divPrint" style="display:none">

    </div>
   
      
    <div id="divPrintPaper" style="width: 640px; font-size: 12px; display: none;">
<%--        <table style="width: 640px; padding: 10px 0px;">
            <tr>
                <td align="center" style="font-size: 18px; font-weight: bolder; text-align: center;">
                    <span>三泰 "粮食银行" 储户兑现凭证</span>
                   
                </td>
            </tr>
            <tr>
                <td align="center" style="font-size: 12px; font-weight: bold; text-align: center;">
                 <span>防伪码：</span>  <span id="spanGUID"></span>&nbsp;&nbsp;
                  <span>编号：</span>  <span id="P_BianHao"></span>
                </td>
            </tr>
        </table>
        <table style="font-size: 14px; padding-bottom:5px;">
            <tr>

                <td style="width: 160px;">
                    <span >姓名：</span>  <span id="P_XingMing">姓名</span>
                </td>
                <td style="width: 160px;">
                    <span>账号：</span><span id="P_ZhangHao">账号</span>
                </td>
                <td style="width: 160px;">
                    <span>存储产品：</span> <span id="P_ChanPin">存储产品</span>
                </td>
                <td style="width: 160px;">
                    <span>上期结存：</span> <span id="P_JieCun">上期结存</span>
                </td>
            </tr>
        </table>
        <table class="tabData" style="padding: 5px 0px; font-size: 14px;">
            <style>
                table.tabData
                {
                    border-collapse: collapse;
                    border: 1px solid #9CF;
                    font-size: 14px;
                }
                table.tabData thead td, table.set_border th
                {
                    font-weight: bold;
                    background-color: White;
                }
                table.tabData tr:nth-child(even)
                {
                    background-color: #EAF2D3;
                }
                table.tabData td, table.border th
                {
                    border: 1px solid #C3C3C3;
                }
            </style>
            <tr style="height: 20px;">
                <td style="width: 70px; border: 1px solid #C3C3C3;">
                    <span>保值</span>
                </td>
                <td style="width: 70px; border: 1px solid #C3C3C3;">
                    <span>数量</span>
                </td>
                <td align="center" style="width: 110px; border: 1px solid #C3C3C3;">
                    <span id="P_ShuLiang"></span>
                </td>
                <td style="width: 70px;">
                    <span>结算价</span>
                </td>
                <td align="center" style="width: 110px;">
                    <span id="P_JieSuanJia"></span>
                </td>
                <td style="width: 90px;">
                    <span>结算金额</span>
                </td>
                <td align="center" style="width: 120px;">
                    ￥<span id="P_JSJinE">2350</span>
                </td>
            </tr>
            <tr style="height: 20px;">
                <td >
                    <span>利息</span>
                </td>
                 <td >
                    <span>实存天数</span>
                </td>
                <td align="center">
                    <span id="P_TianShu"></span>
                </td>
                  <td >
                    <span>利率</span>
                </td>
                <td align="center">
                    <span id="P_LiLv"></span><span>元/</span>  <span id="spanUnit2"></span>
                </td>
                  <td >
                    <span>利息金额</span>
                </td>
                <td align="center" >
                   ￥ <span id="P_LiXi"></span>
                </td>
            </tr>
            <tr style="height: 20px;">
                  <td >
                    <span>保管费</span>
                </td>
                 <td >
                    <span>实存天数</span>
                </td>
                <td align="center" >
                    <span id="P_TianShu2"></span>
                </td>
                 <td >
                    <span>费率</span>
                </td>
                <td align="center" >
                    <span id="P_FeiLv"></span>
                </td>
                  <td >
                    <span>保管费金额</span>
                </td>
                <td align="center" >
                    ￥<span id="P_BGFJinE"></span>
                </td>
            </tr>
            <tr style="height: 20px;">
                  <td >
                    <span>总收益</span>
                </td>
                <td colspan="5" >
                    <span></span>
                </td>
                <td align="center" >
                    ￥<span id="P_ZongShouYi"></span>
                </td>
            </tr>
            <tr style="height: 20px;">
                  <td >
                    <span>大写收益</span>
                </td>
                <td colspan="6" align="left" >
                    <span id="P_DaXie"></span>
                </td>
            </tr>
        </table>
        <table style="font-size: 14px; padding:5px 0px;">
            <tr style="height: 25px;">
                <td style="width: 80px;">
                    <span>折合小麦：</span>
                </td>
                <td style="width: 170px;">
                    <span id="P_ZheHe"></span>
                </td>
                <td style="width: 80px;">
                    <span>计量单位：</span>
                </td>
                <td style="width: 100px;">
                    <span id="P_DanWei"></span>
                </td>
                <td style="width: 80px;">
                    <span>小麦结存：</span>
                </td>
                <td style="width: 140px;">
                    <span id="P_JieCunNow"></span>  <span id="spanUnit3"></span>
                </td>
            </tr>
            <tr style="height: 25px;">
                <td>
                    <span>结算日期：</span>
                </td>
               <td>
                    <span id="P_RiQi"></span>
                </td>
               <td>
                    <span>营业网点：</span>
                </td>
               <td>
                    <span><%=WBName %></span>
                </td>
               <td>
                    <span>营业员：</span>
                </td>
               <td>
                     <span><%=UserName %></span>
                </td>
            </tr>
            <tr style="height: 25px;">
               <td>
                    <span>身份证号：</span>
                </td>
                <td>
                   <div style="width:180px;height:25px; border-bottom:1px solid #333;"></div>
                </td>
                <td>
                </td>
                <td>
                </td>
               <td>
                    <span>储户签名：</span>
                </td>
              <td>
                       <div style="width:100px; height:25px; border-bottom:1px solid #333;"></div>
                </td>
            </tr>
        </table>--%>
    </div>
    <form id="form1" runat="server">
    <div class="pageHead">
       <b>储户产品存转销</b><span id="spanHelp" style="cursor: pointer">帮助</span>
    </div>
    <div id="divHelp"  class="pageHelp">
<span>提示1：定期储户到期存转销按到期价结算，不到期储户经授权后，存转销按活期结算；
活期 分红类储户存转销按市场价结算，涨价时储户按约定的比例受益（一般比例为70%，俗称正三七），落价时储户按约定的比例担损（一般比例为30%，俗称倒三七）；
活期 付息类储户存转销时按存入时的约定存入价+利息（一般利率为：0.01元/公斤/月）进行结算。</span><br />
<span>提示2：定期储户如果不到期支取，需要预先提出申请，管理员审批通过方能结算；如果储户支取额度大于营业员的支取额度，也需要提出申请，管理员审批通过才能支取</span><br />
<span>提示3：实际利率 = 开户时约定的月利息 * 实存天数 / 30。保管费 = 结算数量 * 约定保管费率 * 实存天数 / 360</span><br />
</div>

    <div style="margin: 20px 0px;">
        <div id="Query">
            <span>储户账号:</span>
            <input type="text" id="QAccountNumber" style="font-size:16px; font-weight:bolder;" runat="server" />
           &nbsp; <span>密码:</span>
            <input type="password" id="QPassword" style="font-size:12px;  width:100px;" runat="server" />
            <asp:ImageButton ID="ImageButton1"  ImageUrl="~/images/seach_brown.png" 
                runat="server" onclick="ImageButton1_Click" />
        </div>
           <div id="depositorInfo" runat="server"   style="display:none;">
            <table class="tabData"  style="margin:20px 0px;">
                <tr >
                    <td colspan="6" style="border-bottom:1px solid #aaa; height:25px; text-align:center">
                        <span style="font-size: 16px; font-weight: bolder; color:Green">储户基本信息</span>
                    </td>
                </tr>
                <tr>
                    <th align="center" style="width:100px; height:30px;">
                        储户账号
                    </th>
                    <th align="center" style="width:100px;">
                        储户姓名
                    </th>
                     <th align="center" style="width:100px;">
                        移动电话
                    </th>
                      <th align="center" style="width:100px;">
                        当前状态
                    </th>
                      <th align="center" style="width:150px;">
                        身份证号
                    </th>
                     <th align="center" style="width:200px;">
                        储户地址
                    </th>
                   
                </tr>
                   <tr>
                  
                    <td style="height:30px;">
                        <span style="font-weight:bolder; color:Blue;" id="D_AccountNumber"   runat="server"></span>
                    </td>
                    
                    <td>
                        <span style="font-weight:bolder; color:Blue;" id="D_strName" runat="server"></span>
                    </td>
                    <td>
                        <span style="font-weight:bolder; color:Blue;" id="D_PhoneNo" runat="server"></span>
                    </td>
                     <td>
                        <span style="font-weight:bolder; color:Blue;" id="D_numState" runat="server"></span>
                    </td>
                      <td>
                        <span style="font-weight:bolder; color:Blue;" id="D_IDCard" runat="server"></span>
                    </td>
                    <td>
                        <span style="font-weight:bolder; color:Blue;" id="D_strAddress" runat="server"></span>
                    </td>
                </tr>
            </table>
        </div>
        <div id="StorageList" runat="server">
        <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
                <table class="tabData" >
                    <tr class="tr_head">
                        <th style="width: 100px; height:20px; text-align: center;">
                            存贷产品
                        </th>
                        <th style="width: 80px; text-align: center;">
                            结存数量
                        </th>
                        <th style="width: 100px; text-align: center;">
                            存入时间
                        </th>
                        <th style="width: 80px; text-align: center;">
                            存入价
                        </th>
                        <th style="width: 80px; text-align: center;">
                            存期
                        </th>
                        <th style="width: 80px; text-align: center;">
                            天数
                        </th>
                        <th style="width: 80px; text-align: center;">
                            活期利率
                        </th>
                        <th style="width: 100px; text-align: center;">
                            利息
                        </th>
                        <th style="width: 160px; text-align: center;">
                            结算类型
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr style='background-color: <%#(Container.ItemIndex%2==0)?"#FFFFF;":"#fcf3f4"%>'
                    onmouseover="change_colorOver(this)" onmouseout="change_colorOut(this)">
                    <td style="height:25px;">
                        <%#Eval("VarietyID")%>
                    </td>
                    <td>
                        <%#Eval("StorageNumber")%>
                    </td>
                    <td>
                        <%#Eval("StorageDate")%>
                    </td>
                    <td>
                        <%#Eval("Price_ShiChang")%>
                    </td>
                    <td>
                        <%#Eval("TimeID")%>
                    </td>
                    <td>
                        <%#Web.common.GetDay(Eval("StorageDate"))%>
                    </td>
                    <td>
                        <%#Eval("CurrentRate")%>
                    </td>
                    <td>
                      <%#Web.common.GetLiXi(Eval("ID"))%>
                      </td>
                    <td>
                       <a href="/User/Exchange/ExchangeGoods.aspx?Dep_SID=<%#Eval("ID") %>">兑换</a>&nbsp;
                    <a href="/User/Exchange/StoreToSell.aspx?Dep_SID=<%#Eval("ID") %>">存转销</a>&nbsp;
                       <a href="/User/Storage/StorageRenew.aspx?Dep_SID=<%#Eval("ID") %>">结息</a>
                       
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
            <tr>
            <td colspan="2">
            <span style="font-weight:bolder">折合现金合计:</span>
            </td>
            <td colspan="6" style="text-align:center">
            <span id="spanTotal" runat="server" style="color:Red; font-size:16px">￥<%=Web.common.numTotol %></span>
          
            </td>
            </tr>
                <!--底部模板-->
                </table>
                <!--表格结束部分-->
            </FooterTemplate>
        </asp:Repeater>
        </div>
        <div id="Storage" style="display:none;">
          <table class="tabData" style="margin:20px 0px;">
          <tr>
          <td colspan="6" style="font-weight:bolder; height:25px; color:Green; font-size:16px; border-bottom:1px solid #888;">存储信息</td>
          </tr>
                    <tr class="tr_head">
                        <th style="width: 200px; height:30px; text-align: center;">
                            存储产品
                        </th>
                        <th style="width: 110px; text-align: center;">
                            结存数量
                        </th>
                        <th style="width: 110px; text-align: center;">
                            存入时间
                        </th>
                        <th style="width: 110px; text-align: center;">
                            存入价
                        </th>
                        <th style="width: 110px; text-align: center;">
                            存期
                        </th>
                        <th style="width: 110px; text-align: center;">
                            天数
                        </th>
                    </tr>
                    <tr>
                     <td style="height:30px;"><span id="VarietyID" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                     <td><span id="StorageNumber" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                      <td><span id="StorageDate" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                       <td><span id="Price_ShiChang" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                        <td><span id="TimeID" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                         <td><span id="numDate" style="font-weight:bolder; color:Blue; padding:5px 0px;"></span></td>
                    </tr>
                    </table>
           
        </div>
        
             
        <div id="divSell" style="display:none;">
            <table>
                <tr>
                    <td align="right" style="width: 100px;">
                        <span>保管费率:</span>
                    </td>
                    <td>
                        <input type="text" name="StorageFee" value="0" readonly="readonly"  style="width: 100px; background:#ccc;" /><span>由系统填写</span>

                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <span>约定利率:</span>
                    </td>
                    <td>
                        <input type="text" name="CurrentRate" value="0" readonly="readonly"  style="width: 100px; background:#ccc;" /><span>由系统填写</span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <span>存转销数量:</span>
                    </td>
                    <td>
                        <input type="text" name="VarietyCount" value="0" onblur="FunJiSuan();"   style="width: 100px;" /><span style="color:Red">*</span>
                        <span id="spanUnit"></span>
                        <input type="button" id="btnJiSuan" value="计算" onclick=" FunJiSuan();" style="width:60px;" />&nbsp;
                         <input type="button" id="btnFanSuan" value="反算" onclick=" FunFanSuan();" style="width:60px;" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <span>折合现金:</span>
                    </td>
                    <td>
                        <input type="text" name="VarietyMoney" value="0"  onblur="FunFanSuan();"  style="width: 100px;" /><span >元</span>
                      
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <span>结算日期:</span>
                    </td>
                    <td>
                        <input type="text" id="dt_Sell"  style="width: 150px;" />
                      
                    </td>
                </tr>
                  <tr>
                    <td colspan="2">
                        <div id="divMsg" style="color:Red" >

                        </div>
                    </td>
                </tr>
                  <tr id="trApply">
                    <td></td>
                    <td>
                     <input type="button" id="btnApply" value="去申请存转销售" onclick="FunApply()" />
                    </td>
                </tr>
                <tr id="trSell">
                    <td>
                    </td>
                    <td>
                        <input type="button" id="btnAdd" value="结账" style="width:80px; font-size:18px; font-weight:bolder; color:Blue; border:1px solid #888;" onclick="InitBusinessNO()" />&nbsp;&nbsp;
                     
                         <input type="button" id="btnPrint" value="打印存折" disabled="disabled" onclick="PrintCunZhe()" />&nbsp;
                       <input type="button" id="btnPage" value="打印小票"  disabled="disabled" onclick="PrintPage()" />
                     
                       
                    </td>
                </tr>
              
            </table>
        </div>


       
    </div>
    
    <div  style="display:none;">
       <%--利息--%>
       <input type="text"  name="txtLiXi" value="" />
       <%--保管费--%>
       <input type="text"  name="txtBGF" value="" />

      <input type="text"  name="BusinessNO" value="" />
       <input type="text"  name="txtVarietyPrice" value="" />
     <%--存转销的审核编号--%>
     <input type="text" name="ApplyID" value="" />
  
     
      <%--选择兑换的存储产品信息--%>
     <input type="text" name="txtDep_SID" value="" />
    
     <%--当前存期是否是定期--%>
    <input type="text" name="ISRegular" value="" />
    <%--当前计算利息类型--%>
    <input type="text" name="InterestType" value="" />
    <%--约定存期--%>
    <input type="text" name="numStorageDate" value="" />
     <%--价格政策期限--%>
    <input type="text" name="PricePolicy" value="" />
     <%--储户已存储天数--%>
    <input type="text" name="DepStorageDate" />
       <%--产品市场价--%>
    <input type="text" name="txtPrice_ShiChang" />
    <%--上期结存--%>
    <input type="text" name="txtJieCun" />

    <input type="text" name="txtTimeID" value="" />
    <input type="text"  name="txtVarietyID" value="" />
    </div>
    </form>
    
    <%--定义编号--%>
    <input type="hidden" id="WBID" value="" />
    <%--定义背景色的隐藏域--%>
    <input type="hidden" id="colorName" value="" />
</body>
</html>

